package com.gdzn.netty.redis.queue;

import cn.hutool.json.JSONUtil;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Configuration;
import org.springframework.data.redis.core.RedisTemplate;

import java.util.Map;


@SuppressWarnings("SpringJavaInjectionPointsAutowiringInspection")
@Configuration
public class MessageSender {


    @Autowired
    public RedisTemplate redisTemplate;

    public void sendMessage(String jsonStr) {
        redisTemplate.convertAndSend("chat1", jsonStr);
    }

    public void sendMessage(Map<String, Object> map) {
        redisTemplate.convertAndSend("chat1", map);
    }
}
